package cz.muni.fi.pv168.realestate;

/**
 * This entity represents Owner. Owner have a name, surname and address.
 * One owner can own zero or more properties (real estates).
 * 
 * @author Martin Štrbák
 */
public class Owner {

	private Long id;
	private String name;
	private String surname;
	private String address;
	
	public Long getId()
	{
		return id;
	}
	
	public String getName() {
		return name;
	}
	
	public String getSurname() {
		return surname;
	}	
	
	public String getAddress() {
		return address;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public void setSurname(String surname) {
		this.surname = surname;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public int hashCode() {
		int hash = 3;
		hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		
		final Owner other = (Owner) obj;
		if (this.id != other.id && (this.id == null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return id+": "+name+" "+surname;
	}
	
	
}
